<!DOCTYPE html>
<html>
<head>
<title>管理员列表</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/font-awesome.min.css">
<link rel="stylesheet" href="../../css/AdminLTE.min.css">
<link rel="stylesheet" href="../../css/all-skins.min.css">
<link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../../plugins/datepicker/bootstrap-datetimepicker.min.css">
<link rel="stylesheet" href="../../css/main.css">
<script src="../../libs/jquery.min.js"></script>
<script src="../../plugins/layer/layer.js"></script>
<script src="../../libs/bootstrap.min.js"></script>
<script src="../../libs/vue.min.js"></script>
<script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../../plugins/datepicker/bootstrap-datetimepicker.min.js"></script>
<script src="../../plugins/datepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script src="../../js/common.js"></script>
<script src="../../libs/app.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn row">
			<div class="form-group ">
				<div class="input-group date">
					<div class="input-group-addon">手机号:</div>
					<input type="text" class="form-control" v-model="q.mobile" @keyup.enter="query" >
					<div class="input-group-addon">余额:</div>
					<input type="text" class="form-control" v-model="q.amtLess" @keyup.enter="query" >
					<div class="input-group-addon">
						<span>-</span>
					</div>
					<input type="text" class="form-control" v-model="q.amtMore" @keyup.enter="query" >
					<div class="input-group-addon">注册时间:</div>
					<input id="registeredBeg" type="text" v-model="q.registeredBeg"  class="form-control "  @keyup.enter="query">
					<div class="input-group-addon">
						<span>-</span>
					</div>
					<input id="registeredEnd" type="text" v-model="q.registeredEnd" class="form-control"  @keyup.enter="query" >
					<div class="input-group-btn">
						<a class="btn btn-default" @click="query()">查询</a>
					</div>
					<div class="input-group-btn">
						<a  class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
					</div>
					<!--<div class="input-group-btn">
						<a  class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
					</div>-->
				</div>
				</div>
		</div>
		<table id="jqGrid"></table>
		<div id="jqGridPager"></div>
	</div>

	<div v-show="showAdd" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
				<div class="col-sm-2 control-label">手机号</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="member.mobile" placeholder="手机号"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">姓名</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="member.profile.realName" placeholder="姓名"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">性别</div>
				<label class="radio-inline">
					<input type="radio" name="gender" value="1" v-model="member.profile.gender"/> 男
				</label>
				<label class="radio-inline">
					<input type="radio" name="gender" value="2" v-model="member.profile.gender"/> 女
				</label>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label">生日</div>
				<div class="col-sm-10">
					<input type="text" class="form-control" v-model="member.profile.birthday" placeholder="生日"/>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div>
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
	<div v-if="showdtl">
		<div class="box  box-widget widget-user">
			<!-- Add the bg color to the header using any of the bg-* classes -->
			<div class="widget-user-header bg-aqua-active">
				<div class="pull-right"><input type="button" class="btn btn-warning" @click="reload" value="返回"/></div>
				<h3 class="widget-user-username" v-if="member.mobile">{{member.mobile}}</h3>
				<h4 class="widget-user-username" v-if="member.profile.realName">{{member.profile.nickName}}</h4>
				<h5 class="widget-user-desc">{{member.profile.fitPurpose}}</h5>
			</div>
			<div class="widget-user-image">
				<img  class="img-circle" :src="member.profile.memberAvatar==null?'../../imgs/default-50x50.gif':member.profile.memberAvatar" alt="头像">
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-4 border-right">
						<div class="description-block">
							<h5 class="description-header" v-if="member.profile.gender==0">性别:&nbsp;未知</h5>
							<h5 class="description-header" v-if="member.profile.gender==1">性别:&nbsp;男</h5>
							<h5 class="description-header" v-if="member.profile.gender==2">性别:&nbsp;女</h5>
						</div>
					</div>
					<div class="col-sm-4 border-right">
						<div class="description-block">
							<h5 class="description-header">生日:&nbsp;{{member.profile.birthday==null?'-':member.profile.birthday}}</h5>
						</div>
					</div>
					<div class="col-sm-4">
						<div class="description-block">
							<h5 class="description-header">账户余额:&nbsp;{{member.account.accountAmt}}</h5>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-4 border-right">
						<div class="description-block">
							<h5 class="description-header" >星座:&nbsp;{{member.profile.constellation==null?'-':member.profile.constellation}}</h5>
						</div>
					</div>
					<div class="col-sm-4 border-right">
						<div class="description-block">
							<h5 class="description-header">身高(cm):&nbsp;{{member.profile.height==null?'-':member.profile.height}}</h5>
						</div>
					</div>
					<div class="col-sm-4">
						<div class="description-block">
							<h5 class="description-header">体重(kg):&nbsp;{{member.account.weight==null?'-':member.account.weight}}</h5>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="box box-solid box-info">
			<div class="box-header with-border">
				<h3 class="box-title">上课记录</h3>

				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="折叠">
						<i class="fa fa-minus"></i></button>
				</div>
			</div>
			<div class="box-body table-responsive no-padding">
				<table v-if="member.bookedLessons" class="table table-hover">
					<tr>
						<th>课程名</th>
						<th>课程教练</th>
						<th>课程开始时间</th>
						<th>课程结束时间</th>
						<th>课程状态</th>
					</tr>
					<tr v-for="lesson in member.bookedLessons">
						<td>{{lesson.lessonName}}</td>
						<td><span class="label label-success" v-for="coach in lesson.coachs">{{coach.coachName}}</span></td>
						<td> {{lesson.lessonBegTime}}</td>
						<td>{{lesson.lessonEndTime}}</td>
						<td><span class="label label-default">{{lessonBookFlag[lesson.bookFlag]}}</span></td>
					</tr>
				</table>
			</div>
			<!-- /.box-body -->
			<div class="box-footer"></div>
			<!-- /.box-footer-->
		</div>
		<div class="box box-solid box-info">
			<div class="box-header with-border">
				<h3 class="box-title">优惠券记录</h3>

				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="折叠">
						<i class="fa fa-minus"></i></button>
				</div>
			</div>
			<div class="box-body table-responsive no-padding">
				<table class="table table-hover">
					<tr>
						<th>券名称</th>
						<th>券金额</th>
						<th>领取时间</th>
						<th>失效时间</th>
						<th>券状态</th>
					</tr>
					<tr v-for="coupon in member.couponItems">
						<td>{{coupon.name}}</td>
						<td>{{coupon.marketPrice}}</td>
						<td>{{coupon.createdTime}}</td>
						<td>{{coupon.validEndTime}}</td>
						<td>
							<span v-if="coupon.couponStatus==1" class="label label-success">有效</span>
							<span v-if="coupon.couponStatus==2" class="label label-info">已使用</span>
							<span v-if="coupon.couponStatus==3" class="label label-warning">已过期</span>
						</td>
					</tr>

				</table>
			</div>
			<!-- /.box-body -->
			<div class="box-footer"></div>
			<!-- /.box-footer-->
		</div>
		<div class="box box-solid box-info">
			<div class="box-header with-border">
				<h3 class="box-title">充值记录</h3>
				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="折叠">
						<i class="fa fa-minus"></i></button>
				</div>
			</div>
			<div class="box-body table-responsive no-padding">
				<table class="table table-hover">
					<tr>
						<th>金额</th>
						<th>说明</th>
						<th>充值时间</th>
					</tr>
					<tr v-for="rechargeLog in member.rechargeLogs">
						<td>{{rechargeLog.rechargeAmt}}</td>
						<td>{{rechargeLog.note}}</td>
						<td>{{rechargeLog.createdTime}}</td>
					</tr>
				</table>
			</div>
			<!-- /.box-body -->
			<div class="box-footer"></div>
			<!-- /.box-footer-->
		</div>
	</div>
	<!--充值-->
	<div id="exchangeLayer" style="display: none;">
		<form class="form-horizontal">
			<div class="form-group">
				<div class="form-group">
					<div class="col-sm-2 control-label">充值用户:</div>
					<span class="label label-success" style="vertical-align: bottom;">{{exchange.mobile}}</span>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">充值金额:</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="exchange.exchangeAmt" placeholder="充值金额"/>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>

<script src="../../js/modules/sys/member.js"></script>
</body>
</html>